package com.ibeetl.job;

import com.ibeetl.cms.service.XxdStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 首页统计任务
 */
@Component
public class StatisticsJob {

    @Autowired
    private XxdStatisticsService xxdStatisticsService;

    /**
     * 每天23时59分59秒触发
     */
    @Scheduled(cron = "59 59 23 * * ?")
    public void cronStatistics() {
        try {
            xxdStatisticsService.insert();
        }catch (Exception e){
            System.out.println("统计失败");
        }
    }
}
